package com.jcli.jb51_net.article._271803_Pong.com.mr.model;

import java.awt.*;

/**
 * TODO 4.木板
 *
 * @author li
 * @version 1.0
 * @belongsProject novel_20230923
 * @belongsPackage com.jcli.jb51_net.article._271803_Pong.com.mr.model
 * @className Board
 * @createTime 2024-02-24  08:38
 */
public class Board {
    public int x;
    public int y;
    public int width;
    public int height;
    public int speed;
    public Board(int type) {
        width=8;
        height=120;
        speed=15;
        y=500-height/2;
        if (type==0) {
            x=0;
        } else {
            x=850-15-width;
        }
    }
    public void checkBound() {
        if (y+height>=985) {
            y=985-height;
        }
        if (y<=0) {
            y=0;
        }
    }
    public Rectangle getBound() {
        return new Rectangle(x,y,width,height);
    }
}
